package org.idea.qiyu.live.framework.redis.starter.key;

import org.idea.qiyu.live.framework.redis.starter.key.common.RedisKeyBuilder;
import org.idea.qiyu.live.framework.redis.starter.key.common.RedisKeyLoadMatch;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
@Conditional(RedisKeyLoadMatch.class)
public class BankProviderCacheKeyBuilder extends RedisKeyBuilder {

    private static final String BALANCE_CACHE_KEY = "balanceCache";
    private static final String SEND_GIFT_CACHE_KEY = "sendGift";
    private static final String PRODUCT_LIST_CACHE_KEY = "productList";
    private static final String PRODUCT_CACHE_KEY = "productList";

    public String buildProductCacheKey(Integer productId) {
        return super.getPrefix() + PRODUCT_CACHE_KEY + super.getSplitItem() + productId;
    }

    public String buildBalanceCacheKey(Long userId) {
        return super.getPrefix() + BALANCE_CACHE_KEY + super.getSplitItem() + userId;
    }

    public String buildSendGiftCacheKey(Long userId) {
        return super.getPrefix() + SEND_GIFT_CACHE_KEY + super.getSplitItem() + userId;
    }

    public String buildProductListCacheKey(Integer type) {
        return super.getPrefix() + PRODUCT_LIST_CACHE_KEY + super.getSplitItem() + type;
    }
}